#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>

int hello_probe(struct platform_device *pdev)
{
	int i;

	printk("hello_probe \n");

	for(i = 0; i < sizeof(pdev->resource); i++)
		printk("resource[%d] = 0x%llx \n", i, pdev->resource[i].start);

	return 0;
}

int hello_remove(struct platform_device *pdev)
{
	printk("hello_remove \n");
	return 0;
}

struct platform_driver hello_driver = {
	.driver.name = "hello",
	.probe = hello_probe,
	.remove = hello_remove,
};

static int hello_init(void)
{
	int ret = 0;
	printk(KERN_ALERT "hello_init \n");
	platform_driver_register(&hello_driver);
	return ret;
}

static void hello_exit(void)
{
	printk(KERN_ALERT "hello_exit \n");
	platform_driver_unregister(&hello_driver);
	return;
}

MODULE_LICENSE("Dual BSD/GPL");

module_init(hello_init);
module_exit(hello_exit);
